<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/ainit.css" />
 	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/homepages/js/functions.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.1.2.2.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ainit-1.0.0.js"></script>
	<script type="text/javascript">
		var a = document.documentElement.clientHeight - 72;
		var b = document.documentElement.clientWidth - 25;
		$(function(){
			 //去请求Column
			 loadColumn();
		});
		
		function  loadColumn(){
			$.ajax({
				type:'post',
				url:'${pageContext.request.contextPath}/framework/columnList',
				data:{'colId':'AccountRun','flag':''},
				success:function(data){
					if(data ==""){
						alert("数据为空");
					}else{
						//请求一个组织列的方法
						makeColumns(data);
					}
					//去请求按钮
					loadButns();
				}
			});
		}
		
		function loadButns(){
			$.ajax({
				type:'post',
				url:'${pageContext.request.contextPath}/framework/buttonsList',
				data:{'butnId':'AccountRun'},
				success:function(data){
					if(data == ""){
						alert("按钮数据为空");
					}else{
						//请求一个组织按钮的方法
						var buttons = data;
						var butHTML = "";
						for(var i = 0; i < buttons.length; i++){
							butHTML += formatButtons(buttons[i]);
						}
						$('#BUTTONS').html(butHTML);
						$.parser.parse();  //重新编译界面
					}
					//请求datagrid
					loadDategrid();
				}
			})
		}
		function loadDategrid(){
			$.ajax({
				type:'post',
				url:'${pageContext.request.contextPath}/framework/listQueryJson',
				data:{'dsId':'AccountRun','colId':'AccountRun'},
				success:function(data){
					if(data==""){
						alert("数据为空");
					}else{
						//给datagrid赋列值，还有rows
						makeDatagrid(data);
					}
				}
			})
		}
		
		
		
	</script>
</head>
<body  onresize="resizeGrid();">
	<form action="" method="post" id="queryForm">
		<table cellpadding="0" cellspacing="0">
			<tr>
				<td>
					<!-- 部分查询框 -->
					<table id="COLUMNS">
					</table>
				</td>
				<td style="vertical-align: top;">
					<!-- 部分按钮 -->
					<div id="BUTTONS" style="width:195px;padding-left: 20px;"></div>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<!-- 数据列表 -->	
					<table  id="DATALIST"></table>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>